<!--更新气体信息-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>修改气体信息</title>
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css">
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>修改气体信息</legend>
</fieldset>
<!--面板-->
<div class="layui-card">
    <div class="layui-card-header"></div>
    <div class="layui-card-body">
        <!--表单-->
        <form class="layui-form"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
            <div class="layui-form-item">
                <label class="layui-form-label">气体编号</label>
                <div class="layui-input-block">
                    <input type="text" name="gasId" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">气体名称</label>
                <div class="layui-input-block">
                    <input type="text" name="gasName" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">气体含量上限</label>
                <div class="layui-input-block">
                    <input type="text" name="gasContent" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">气体危险等级</label>
                <div class="layui-input-block">
                    <select name="harm">
                        <option value=""></option>
                        <option value="低">低</option>
                        <option value="中">中</option>
                        <option value="高">高</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">主要特征</label>
                <div class="layui-input-block">
                    <input type="text" name="features" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">主要来源</label>
                <div class="layui-input-block">
                    <input type="text" name="source" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">应急措施</label>
                <div class="layui-input-block">
                    <input type="text" name="measure" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../lib/layui-v2.6.3/layui.js"></script>
<script src="//lib.baomitu.com/layer/3.5.1/layer.js"></script>

<script>
    //Demo
    layui.use('form', function() {
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function (data) {
            $.ajax({
                url: "/record/update",
                type: "POST",
                data: data.field,
                dataType: "JSON",
                success: function (result) {
                    layer.msg(result);
                }
            })
            layer.msg('更新成功',{
                time:1000,
                icon:1,
            });
            return false;
        });
    })
</script>
</body>
</html>